package com.czkevin.cif.types.blocks;

import com.czkevin.cif.BaseBlock;
import com.czkevin.cif.CIFItemInstance;
import com.czkevin.cif.crafting.gui.AdvancedCraftingGUI;
import de.tr7zw.nbtapi.NBTCompound;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.EquipmentSlot;

public class AdvancedCraftingBench extends BaseBlock {

    @Override
    public String getDisplayName(NBTCompound data) {
        return "Advanced Crafting Bench";
    }

    @Override
    public int getCustomModelData(CIFItemInstance instance) {
        return 1;
    }

    @Override
    public void onBlockUse(CIFItemInstance instance, PlayerInteractEvent event) {
        if(event.getHand() == EquipmentSlot.HAND && event.getAction() == Action.RIGHT_CLICK_BLOCK) {
            new AdvancedCraftingGUI().open(event.getPlayer());
        }
    }
}
